<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content=
    "application/xhtml+xml; charset=iso-8859-1" />
    <title>
      libxml2-2.9.10
    </title>
    <link rel="stylesheet" type="text/css" href="../stylesheets/lfs.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
    "text/css" media="print" />
  </head>
  <body class="blfs" id="blfs-2020-04-02">
    <div class="navheader">
      <h4>
        Beyond Linux<sup>�</sup> From Scratch <span class="phrase">(System
        V</span> Edition) - Version 2020-04-02
      </h4>
      <h3>
        Chapter&nbsp;9.&nbsp;General Libraries
      </h3>
      <ul>
        <li class="prev">
          <a accesskey="p" href="libxkbcommon.html" title=
          "libxkbcommon-0.10.0">Prev</a>
          <p>
            libxkbcommon-0.10.0
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="libxslt.html" title=
          "libxslt-1.1.34">Next</a>
          <p>
            libxslt-1.1.34
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="genlib.html" title=
          "Chapter&nbsp;9.&nbsp;General Libraries">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 2020-04-02">
          Home</a>
        </li>
      </ul>
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <h1 class="sect1">
        <a id="libxml2" name="libxml2"></a>libxml2-2.9.10
      </h1>
      <div class="package" lang="en" xml:lang="en">
        <h2 class="sect2">
          Introduction to libxml2
        </h2>
        <p>
          The <span class="application">libxml2</span> package contains
          libraries and utilities used for parsing XML files.
        </p>
        <p>
          This package is known to build and work properly using an LFS-9.1
          platform.
        </p>
        <h3>
          Package Information
        </h3>
        <div class="itemizedlist">
          <ul class="compact">
            <li class="listitem">
              <p>
                Download (HTTP): <a class="ulink" href=
                "http://xmlsoft.org/sources/libxml2-2.9.10.tar.gz">http://xmlsoft.org/sources/libxml2-2.9.10.tar.gz</a>
              </p>
            </li>
            <li class="listitem">
              <p>
                Download (FTP): <a class="ulink" href=
                "ftp://xmlsoft.org/libxml2/libxml2-2.9.10.tar.gz">ftp://xmlsoft.org/libxml2/libxml2-2.9.10.tar.gz</a>
              </p>
            </li>
            <li class="listitem">
              <p>
                Download MD5 sum: 10942a1dc23137a8aa07f0639cbfece5
              </p>
            </li>
            <li class="listitem">
              <p>
                Download size: 5.4 MB
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated disk space required: 87 MB (add 15 MB for tests)
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated build time: 0.2 SBU (add 0.3 SBU for tests)
              </p>
            </li>
          </ul>
        </div>
        <h3>
          Additional Downloads
        </h3>
        <div class="itemizedlist">
          <ul class="compact">
            <li class="listitem">
              <p>
                Optional Testsuite: <a class="ulink" href=
                "http://www.w3.org/XML/Test/xmlts20130923.tar.gz">http://www.w3.org/XML/Test/xmlts20130923.tar.gz</a>
                - This enables <span class="command"><strong>make
                check</strong></span> to do complete testing.
              </p>
            </li>
          </ul>
        </div>
        <h3>
          libxml2 Dependencies
        </h3>
        <h4>
          Optional
        </h4>
        <p class="optional">
          <a class="xref" href="python2.html" title=
          "Python-2.7.17">Python-2.7.17</a>
        </p>
        <div class="admon note">
          <img alt="[Note]" src="../images/note.png" />
          <h3>
            Note
          </h3>
          <p>
            Some packages which utilize <span class=
            "application">libxml2</span> (such as <span class=
            "application">GNOME Doc Utils</span>) need the <span class=
            "application">Python3</span> module installed to function
            properly and some packages will not build properly if the
            <span class="application">Python3</span> module is not available.
          </p>
          <p>
            The old <span class="application">Python2</span> module can be
            built after <code class="filename">libxml2.so</code> has been
            installed, see <a class="xref" href=
            "python-modules.html#libxml2py2" title=
            "libxml2-2.9.10 (for its Python2 module)">libxml2-2.9.10 (for
            Python2)</a>.
          </p>
        </div>
        <h4>
          Optional
        </h4>
        <p class="optional">
          <a class="xref" href="icu.html" title="ICU-66.1">ICU-66.1</a> and
          <a class="xref" href="valgrind.html" title=
          "Valgrind-3.15.0">Valgrind-3.15.0</a> (may be used in the tests)
        </p>
        <p class="usernotes">
          User Notes: <a class="ulink" href=
          "http://wiki.linuxfromscratch.org/blfs/wiki/libxml2">http://wiki.linuxfromscratch.org/blfs/wiki/libxml2</a>
        </p>
      </div>
      <div class="installation" lang="en" xml:lang="en">
        <h2 class="sect2">
          Installation of libxml2
        </h2>
        <p>
          If you are going to run the tests, disable one test that prevents
          the tests from completing:
        </p>
        <pre class="userinput">
<kbd class=
"command">sed -i 's/test.test/#&amp;/' python/tests/tstLastError.py</kbd>
</pre>
        <p>
          Install <span class="application">libxml2</span> by running the
          following commands:
        </p>
        <pre class="userinput">
<kbd class="command">./configure --prefix=/usr    \
            --disable-static \
            --with-history   \
            --with-python=/usr/bin/python3 &amp;&amp;
make</kbd>
</pre>
        <p>
          If you downloaded the testsuite, issue the following command:
        </p>
        <pre class="userinput">
<kbd class="command">tar xf ../xmlts20130923.tar.gz</kbd>
</pre>
        <p>
          To test the results, issue: <span class="command"><strong>make
          check &gt; check.log</strong></span>. A summary of the results can
          be obtained with <span class="command"><strong>grep -E
          '^Total|expected' check.log</strong></span>. If <a class="xref"
          href="valgrind.html" title="Valgrind-3.15.0">Valgrind-3.15.0</a> is
          installed and you want to check memory leaks, replace <span class=
          "command"><strong>check</strong></span> with <span class=
          "command"><strong>check-valgrind</strong></span>.
        </p>
        <div class="admon note">
          <img alt="[Note]" src="../images/note.png" />
          <h3>
            Note
          </h3>
          <p>
            The tests use <a class="ulink" href=
            "http://localhost/">http://localhost/</a> to test parsing of
            external entities. If the machine where you run the tests serves
            as a web site, the tests may hang, depending on the content of
            the file served. It is therefore recommended to shut down the
            server during the tests, as the <code class=
            "systemitem">root</code> user:
          </p>
          <pre class="userinput">
<kbd class="command">/etc/init.d/httpd stop</kbd>
</pre>
        </div>
        <p>
          Now, as the <code class="systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class="command">make install</kbd>
</pre>
      </div>
      <div class="commands" lang="en" xml:lang="en">
        <h2 class="sect2">
          Command Explanations
        </h2>
        <p>
          <em class="parameter"><code>--disable-static</code></em>: This
          switch prevents installation of static versions of the libraries.
        </p>
        <p>
          <em class="parameter"><code>--with-history</code></em>: This switch
          enables <span class="application">Readline</span> support when
          running <span class="command"><strong>xmlcatalog</strong></span> or
          <span class="command"><strong>xmllint</strong></span> in shell
          mode.
        </p>
        <p>
          <em class=
          "parameter"><code>--with-python=/usr/bin/python3</code></em>:
          Allows building the libxml2 module with Python3 instead of Python2.
        </p>
        <p>
          <code class="option">--with-icu</code>: Add this switch if you have
          built <a class="xref" href="icu.html" title=
          "ICU-66.1">ICU-66.1</a>, for better unicode support.
        </p>
        <p>
          <code class="option">--with-threads</code>: Add this switch to
          enable multithread support.
        </p>
      </div>
      <div class="content" lang="en" xml:lang="en">
        <h2 class="sect2">
          Contents
        </h2>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong class="segtitle">Installed Programs:</strong>
              <span class="segbody">xml2-config, xmlcatalog, and
              xmllint</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Libraries:</strong>
              <span class="segbody">libxml2.so and libxml2mod.so
              (<span class="application">Python3</span> module)</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Directories:</strong>
              <span class="segbody">/usr/include/libxml2,
              /usr/lib/cmake/libxml2, /usr/share/doc/libxml2-2.9.10,
              /usr/share/doc/libxml2-python-2.9.10, and
              /usr/share/gtk-doc/html/libxml2</span>
            </div>
          </div>
        </div>
        <div class="variablelist">
          <h3>
            Short Descriptions
          </h3>
          <table border="0" class="variablelist">
            <colgroup>
              <col align="left" valign="top" />
              <col />
            </colgroup>
            <tbody>
              <tr>
                <td>
                  <p>
                    <a id="xml2-config" name="xml2-config"></a><span class=
                    "term"><span class=
                    "command"><strong>xml2-config</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    determines the compile and linker flags that should be
                    used to compile and link programs that use <code class=
                    "filename">libxml2</code>.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="xmlcatalog" name="xmlcatalog"></a><span class=
                    "term"><span class=
                    "command"><strong>xmlcatalog</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is used to monitor and manipulate XML and SGML catalogs.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="xmllint" name="xmllint"></a><span class=
                    "term"><span class=
                    "command"><strong>xmllint</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    parses XML files and outputs reports (based upon options)
                    to detect errors in XML coding.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="libxml2-lib" name="libxml2-lib"></a><span class=
                    "term"><code class="filename">libxml2.so</code></span>
                  </p>
                </td>
                <td>
                  <p>
                    provides functions for programs to parse files that use
                    the XML format.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="libxml2mod3" name="libxml2mod3"></a><span class=
                    "term"><code class="filename">libxml2mod.so</code></span>
                  </p>
                </td>
                <td>
                  <p>
                    is the interface for <span class=
                    "application">Python3</span> to use <code class=
                    "filename">libxml2.so</code>.
                  </p>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
      <p class="updated">
        Last updated on 2020-03-10 09:12:43 -0500
      </p>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="libxkbcommon.html" title=
          "libxkbcommon-0.10.0">Prev</a>
          <p>
            libxkbcommon-0.10.0
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="libxslt.html" title=
          "libxslt-1.1.34">Next</a>
          <p>
            libxslt-1.1.34
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="genlib.html" title=
          "Chapter&nbsp;9.&nbsp;General Libraries">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 2020-04-02">
          Home</a>
        </li>
      </ul>
    </div>
  </body>
</html>
